#ifndef LOGIC_DELETE_H
#define LOGIC_DELETE_H

#include <iostream>
#include <string>
#include <vector>

#include "Parser.h"
#include "Data.h"
#include "Task.h"
#include "Writer.h"

#include <boost\date_time.hpp>

using namespace std;
using namespace boost::posix_time;
using namespace boost::gregorian;

class LogicDelete {

public:

	string deleteTaskByIndex(Parser::PARSED_COMMAND parsedCommand, 
								vector<Task>& tasksVector,
								Data* _data,
								Writer* _writer);

	string deleteDoneTask(Parser::PARSED_COMMAND parsedCommand,
								vector<Task>& tasksVector,
								Data* _data,
								Writer* _writer);

	string deleteTaskByName(Parser::PARSED_COMMAND parsedCommand,
								vector<Task>& tasksVector,
								Data* _data,
								Writer* _writer);

	string deleteTaskByString(Parser::PARSED_COMMAND parsedCommand,
								vector<Task>& tasksVector,
								Data* _data,
								Writer* _writer);

	string deleteTaskBySearchTerm(Parser::PARSED_COMMAND parsedCommand,
								vector<Task>& tasksVector,
								Data* _data,
								Writer* _writer);

private:

	static const string DELETE_SUCCESS_MESSAGE;
	static const string DELETE_ERROR_MESSAGE;
	static const string DELETE_TYPE_DONE;

	static const string INDEX_OUT_OF_BOUNDS_ERROR_MESSAGE;
	static const string NOT_FOUND_ERROR_MESSAGE;
	static const int FIRST_POSITION;

	// returns true if matches done keyword and false otherwise
	bool isDeleteByDone(string term);

	// returns true if found in vector and false otherwise
	bool isDeleteByName(string term, Data* _data);

	// returns true if found in vector and false otherwise
	bool isDeleteBySearchTerm(string term, Data* _data);

	bool isOutOfBounds(int index, int size);

	bool isMultipleMatches(int size);

	void copyTasks(vector<Task>& tasks, vector<Task>& tasksVector);
};
#endif